// 云函数入口文件
const cloud = require('wx-server-sdk')

cloud.init({
  env: 'yiibook-pro-yo19d'
})

// 云函数入口函数
exports.main = async (event, context) => {
  return cloud.database().collection('exams').doc(event._id).update({
    data: {
      courseName: event.courseName,
      classes: event.classes,
      examDate: event.examDate,
      startTime: event.startTime,
      endTime: event.endTime,
      examAddress: event.examAddress,
      teacher: event.teacher,
      updated_at: event.updated_at
    },
    success: function(res) {
      return res
    }
  })
}